package com.knight.hadoop.day12.zuoye;

import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

public class GroupLogComparator extends WritableComparator {

	public GroupLogComparator() {
		super(LogBean.class, true);
	}
	
	@Override
	public int compare(WritableComparable a, WritableComparable b) {
		LogBean aBean = (LogBean) a;
		LogBean bBean = (LogBean) b;
		if(aBean.getIp().equals(bBean.getIp())){
			return 0;
		}
		return 1;
	}
}
